Skip to content

Add feedback form override component and host sample#5818

Open
ok-AK wants to merge 3 commits intomicrosoft:mainfrom
ok-AK:alkwiatk/feedbackFormOverride
Open

Add feedback form override component and host sample#5818
ok-AK wants to merge 3 commits intomicrosoft:mainfrom
ok-AK:alkwiatk/feedbackFormOverride

Conversation

@ok-AK
Copy link
Copy Markdown

@ok-AK ok-AK commented Apr 30, 2026

Fixes #

Changelog Entry

  • Added renderFeedbackFormOverrideComponent style option to allow host applications to provide custom feedback form components, in PR #5818
    • Enables hosts to replace the native feedback form with their own UI via styleOptions.renderFeedbackFormOverrideComponent
    • Feedback buttons remain controlled by Web Chat while form rendering is delegated to the host application
    • Added sample and integration tests demonstrating custom feedback form implementation

Description

Adds simple conditional mount native or mount custom feedback form.

Allows the host to override feedback form and replace it with a host provided custom feedback form.

Host will continue using the existing thumbs up/down voting buttons per activity to trigger feedback form mount.

Prime example is shown below. In this example, the host is forced to use a 3rd party library that emits a Dialog that collects feedback. The E2E test has been slowed down so that we can see the dialog taking effect.

WebChat_feedbackFormOverride

Design

NA

Specific Changes

NA

  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

Copilot AI review requested due to automatic review settings April 30, 2026 19:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a host hook to override Web Chat’s native feedback form UI while keeping the built-in thumbs up/down behavior, plus a sample and test coverage for the override flow.

Changes:

  • Introduces styleOptions.renderFeedbackFormOverrideComponent (and exported context type) and wires it into ActivityFeedback.
  • Hardens feedback action selection/submission when actions are missing @id.
  • Adds a new hosted sample and html2 tests validating inline override, submit, dismiss, and “change mind” scenarios.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
samples/05.custom-components/h.feedback-form/index.html New hosted sample showing an inline override host component.
samples/05.custom-components/h.feedback-form/README.md Documentation for the new sample and override pattern.
packages/component/src/ActivityFeedback/providers/ActivityFeedbackComposer.tsx Adds @id guards and adjusts action state handling/typing.
packages/component/src/ActivityFeedback/ActivityFeedback.tsx Implements rendering logic for the feedback form override component.
packages/api/src/index.ts Exports the new context type from the public API surface.
packages/api/src/defaultStyleOptions.ts Adds default value for renderFeedbackFormOverrideComponent.
packages/api/src/StyleOptions.ts Documents and types the new style option and its context.
tests/html2/feedbackForm/feedback.form.middleware.inline*.html Adds html2 tests covering override submit and dismiss/change-mind flows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/api/src/StyleOptions.ts
Comment thread packages/component/src/ActivityFeedback/ActivityFeedback.tsx
Comment thread samples/05.custom-components/h.feedback-form/index.html
Comment thread samples/05.custom-components/h.feedback-form/README.md Outdated
Comment thread samples/05.custom-components/h.feedback-form/README.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants